package palette;

import java.awt.BorderLayout;
import java.awt.Container;
import javax.swing.JSplitPane;

import mainWindowSupport.ShapeExplorer;
import mainWindowSupport.ShapePropTable;
import mainWindowSupport.ShapeProperties;
import mainWindowSupport.ShapeTree;

@SuppressWarnings("serial")
public class DrawingWindow extends CanvasWindow {


	private ShapeExplorer shapeExpl;
	private ShapeProperties shapeProp;
	private JSplitPane sidebarInfoPane;
	private JSplitPane wholeAppPane;
	private ShapeTree shapeTree;
	private ShapePropTable shapeTable;
	
	
	public DrawingWindow(String name){
		super(name);
		
		// moving properties to each canvas
		shapeTree = new ShapeTree();
		shapeTable = new ShapePropTable();
		shapeExpl = new ShapeExplorer();
		shapeProp = new ShapeProperties();
		sidebarInfoPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, shapeExpl.getPane(), shapeProp.getPane());
		sidebarInfoPane.setDividerLocation(198);
				
		shapeProp.setShapeTable(shapeTable);
		shapeExpl.setShapeTree(shapeTree);
		
		shapeList.addObserver(shapeTree);
		shapeList.addObserver(shapeTable);
		
		
		wholeAppPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sidebarInfoPane, myCanvas);
		wholeAppPane.setDividerLocation(175);

		
		Container contentPane = getContentPane();
		contentPane.add(wholeAppPane, BorderLayout.CENTER);
		
	}
	
	
	/*   Getters */
	public ShapeExplorer getShapeExplorer(){ 		return shapeExpl; 	}
	public ShapeProperties getShapeProperties(){ 	return shapeProp; 	}
	public ShapeTree getShapeTree() {				return shapeTree; 	}
	public ShapePropTable getShapeTable() { 		return shapeTable; 	}

}
